home *** CD-ROM | disk | FTP | other *** search
/ BBS Toolkit / BBS Toolkit.iso / pc_board / pcb15nw.zip / EVENT.DOC < prev    next >
Text File  |  1993-05-04  |  12KB  |  214 lines

  1.  
  2. Events
  3. An event is simply a batch file that gets executed during a specific time of
  4. the day.  In this event batch file you could do some of the following things:
  5.  
  6. Pack your users and/or message bases
  7. If you are part of a mail network, you will most likely transfer mail packets
  8. Some third party products you use on your bulletin board may need to run
  9. utilities to update data bases, etc.
  10. Create a list of files on your system using PCBFiler and the /LIST parameter.
  11. Backup your system
  12.  
  13. The previous examples are but only a few of the things you can do in your
  14. event.  Since events simply execute batch files you are more or less limited
  15. by your imagination as far as what you want to run in your event.
  16.  
  17. Adding An Event
  18. To define the events on your system, you need to go to PCBSetup | Event Setup.
  19. Next, you need to make sure that you have answered Y to the Is a Timed Event
  20. Active question.
  21.  
  22. Finally, if you cursor down to the EVENT.DAT line and press 2 you will a
  23. screen that resembles the following:
  24.  
  25.  ══════════════════════════════════════════════════════════════════════════════
  26.                                Event Information
  27.  
  28.                   Batch     Begin  End              Last      Days
  29.         Act  Mod  File      Time   Time   Date      Date      SMTWTFS
  30.         ═══  ═══  ════════  ═════  ═════  ════════  ════════  ═══════
  31.    1)    Y    E   DAILY     06:45  07:00            03-29-93  YYYYYYY
  32.    2)    Y    S   MORNING   05:00  06:00            03-29-93  YYYYYYY
  33.    3)    Y    S   AFTRNOON  14:00  17:00            03-28-93  YYYYYYY
  34.    4)    Y    E   NEWYEAR   00:15  00:30  01-01-00  01-01-93  YYYYYYY
  35.    5)    Y    E   MONTHLY   01:00  01:30  00-01-00  03-01-93  YYYYYYY
  36.    6)    Y    E   WEEKLY    01:00  01:30            03-05-93  YNNNNNN
  37.    7)    N                                          00-00-00  NNNNNNN
  38.    8)    N                                          00-00-00  NNNNNNN
  39.    9)    N                                          00-00-00  NNNNNNN
  40.   10)    N                                          00-00-00  NNNNNNN
  41.   11)    N                                          00-00-00  NNNNNNN
  42.   12)    N                                          00-00-00  NNNNNNN
  43.   13)    N                                          00-00-00  NNNNNNN
  44.   14)    N                                          00-00-00  NNNNNNN
  45.   15)    N                                          00-00-00  NNNNNNN
  46.  
  47.    Modes: E = Expedite (Non-sliding)  S = Sliding
  48.  ══ 11:38:01 ═══ 03-30-93 ══════ F1 ═ help ════ caps: OFF  num: OFF  ins: OFF ═
  49.  
  50. The number to the left of each line is the event number that is being
  51. defined.  The rest of the fields on the screen are as follows:
  52.  
  53. Act             You may enter either a Y or an N in this field.  A Y signifies
  54.                 that the event is active and should be executed as configured.
  55.                 If you enter an N then the event will be considered inactive
  56.                 and will not be run as defined.
  57. Mod             The mode of the event.  You may enter either an E or an S in
  58.                 this field.  If you enter an E then the event is a "rigid" or
  59.                 non-sliding event.  If you enter an S as the event type then
  60.                 the event is referred to as a sliding event.If an event is an
  61.                 expidited or non-sliding event then PCBoard will make it's
  62.                 best attempt to execute the event at the time you specify as
  63.                 the beginning time even if it means cutting users time short.
  64. Batch File      In this field, you need to specify the batch file you wish to
  65.                 execute for the event you are defining.  Note that you are
  66.                 only given 8 characters for the batch filename.  The reason
  67.                 for this is that by default this batch file will be run on
  68.                 all nodes.  However, you can make node specific batch files by
  69.                 making the node number the filename extension.  For example,
  70.                 if you entered a batch file of DAILY and you wanted node 5 to
  71.                 execute a different batch file then you would create a
  72.                 DAILY.005 file
  73. Begin Time      This is the earliest time that you event will be run.  The
  74.                 time that you enter in this field must be in 24 hour format
  75.                 and there must be a colon between the hour and minutes.
  76. End Time        The end time is the latest possible time that you wish for
  77.                 the event to run.  If the event has not run by the time that
  78.                 you enter, then the event will be skipped.
  79. Date            This field enables you to specify the dates that PCBoard will
  80.                 run the event.  For example, if you want the event to run on
  81.                 the first day of every month, then you would enter a date of
  82.                 00-01-00.  Entering a 00 signifies a wildcard.  Using the
  83.                 previous example, this means that it would run for any month,
  84.                 and any year, but only when the day of the month is equal to
  85.                 01.  Another example would be to set the date to 12-25-00.
  86.                 This means that the event would run every Christmas day no
  87.                 matter what
  88. Last Date       Contains the date that the event was last run on the node
  89.                 number that is specified in PCBSetup | Node Configuration.
  90.                 Not all events run system- wide therefore this field only
  91.                 contains the last date ran for the node you are currently
  92.                 editing.
  93. Days            You may also control which days that the event you are
  94.                 defining is run on.  In this field all seven days of the week
  95.                 are listed begining with Sunday and ending with Saturday.
  96.                 Simply enter either a Y or N which signifies whether you want
  97.                 to run the event on the day listed or not.
  98.  
  99. As an example, let's say that you want to have an event that runs at 3:00am
  100. every morning and packs your message bases.  The first step would be to edit
  101. your EVENT.DAT file in PCBSetup | Event Setup.
  102.  
  103. First of all, you will put a Y in the Act column, because this is an active
  104. event and you do want it to run.  Next, you would put an S in the Mod column
  105. because you would like for this event to run at 3:00am but you would not mind
  106. waiting for a caller to logoff before running the event.
  107.  
  108. Next, you need to enter a batch filename.  For lack of a better name you can
  109. enter PACKMSGS as the batch filename.  Now you must enter the earliest time
  110. that you wish for the event to run.  As outlined earlier, you want this event
  111. to begin at 3:00am so you would enter 03:00 in this column.  If the latest
  112. that you want the event to run is 08:00am, then you would need to enter 08:00
  113. in the End Time column.
  114.  
  115. Finally, you need to specify the date and days that the event will run.  If
  116. you leave the Date column blank or filled with 00-00-00 it will run for every
  117. day of the week that you specify in the Days columns.  Because the event will
  118. pack the message bases, you probably want it to run every day of the week so
  119. you would put a Y in every day of the Days column.  Once you have done this
  120. you would have an entry which looks like the following:
  121.  
  122.                   Batch     Begin  End              Last      Days
  123.         Act  Mod  File      Time   Time   Date      Date      SMTWTFS
  124.         ---  ---  --------  -----  -----  --------  --------  -------
  125.     1)   Y    S   PACKMSGS  03:00  08:00            00-00-00  YYYYYYY
  126.               
  127. You have one last problem to overcome.  You need to create the actual batch
  128. file that will execute your event.  In actuallity, this is very easy to do.
  129. Simply highlight the batch file field you want to edit and press 2.  Your
  130. default text editor that you defined in System Manager | Define Text &
  131. Graphics Editors will be used to edit the batch file.
  132.               
  133. For example, your batch file might look like this:
  134.               
  135. PCBPACK /AREA:ALL /MAXMSGS:1024 /MINMSGS:100 /DAYS:30
  136.               
  137. This batch file simply runs PCBPack on all message bases.  Once the message
  138. bases have been packed, BOARD.BAT is reloaded which will make the system once
  139. again available for callers.
  140.               
  141. We have one final problem.  By default this event would run on every node of
  142. the system.  Obviously this would not be a good idea to have every node
  143. packing the message base at the same time.  What you would do then, is to
  144. rename your batch file from PACKMSGS to something like PACKMSGS.003.  By
  145. adding the .003 to the end of the filename, that tells PCBoard that it is a
  146. node specific file and that only node 3 should run that batch file.
  147.  
  148. Multiple Nodes
  149. Frequently, you will need more than one node to participate in an event
  150. whether you want each node to perform a particular task or if you need all
  151. nodes to be down, it is important to understand how to control your events.
  152.  
  153. Node Specific Events
  154. Most likely you do not want all of your nodes to run the event batch file.
  155. You may have one node that does all of the work while the other wait or do
  156. some other tasks.  In the EVENT.DAT file you specify the base event batch
  157. filename.  This is the batch file that will be executed for all nodes unless
  158. there is a node specific event batch file.
  159.               
  160. To create a node specific event batch file, you simply create a file with the
  161. batch filename and an extension of the node number.  For example, if your
  162. event batch file is called MAINT1 and if you wanted to make a batch file that
  163. only node 6 would execute, then you would create a batch file called
  164. MAINT1.006.
  165.               
  166. When event time rolls around, all of the nodes except node 6 will run the
  167. event using the MAINT1 file.  Of course, node 6 will use the MAINT1.006 file.
  168.               
  169. If you wanted only node 6 to run the event and the other nodes to not even
  170. both going down for the event, then you would create the MAINT1.006 file and
  171. then delete the MAIN1 file.  Since the other nodes would not have a batch file
  172. to execute, they will not execute the event.
  173.  
  174. Making Sure All Nodes Are Down
  175. To perform global changes to the system such as sorting the user file, or
  176. doing a total backup of your system, you will need all of your nodes to be
  177. down.  Perhaps the easiest way to accomplish this is to have your nodes
  178. simply run a program as they begin the event that will count for a certain
  179. amount of minutes or seconds while the event is running.  When the nodes are
  180. down counting, they can then reload the board.
  181.               
  182. As an example, let's assume that you are operating a three node system.  You
  183. want node 1 to sort the users file.  In order to do this, nodes 2, and 3 must
  184. not be operating.  Quite simply, you create a node specific event file for
  185. node 1.  If you event batch file is called USRSORT then you would create an
  186. event file called USRSORT.001.  This batch file might look like the following:
  187.               
  188.         @ECHO OFF
  189.         PCBSM /SORT;SECURITY;PRIREVERSEBOARD
  190.               
  191. In your testing, you have found out that it takes about 4 minutes to complete
  192. the sorting process.  Therefore, you need to make sure that the other nodes
  193. stay down for a bare minimum of 4 minutes.  Just to be safe, you could even
  194. keep them down for 10 minutes or so because the time it takes to sort the file
  195. will increase as the number of users on your system increases.
  196.               
  197. You should be able to find several utilities will will count for seconds or
  198. minutes on the PCBoard Support BBS.  For example, if you found one that was
  199. called count and would count for the number of seconds specified, you would
  200. want to make your USRSORT batch file look like the following:
  201.               
  202.         @ECHO OFF
  203.         COUNT 480BOARD
  204.               
  205. Quite simply, this would make nodes 2 and 3 (because a USRSORT.002 or
  206. USRSORT.003 file was not found) count for 480 seconds, then reload the
  207. bulletin board.  This should give more than ample time for the sort process
  208. to be completed.
  209.               
  210. There are several other methods you can use to make sure all events are down
  211. and stay down.  Most of these have been addressed by third party authors and
  212. are available on the PCBoard Support BBS by (Z)ippy scanning for EVENT.
  213.  
  214.